<template>
  <div>
    <er-form-editor :lang="lang" @listener="handleListener" ref="EReditorRef" />
  </div>
</template>

<script setup>
  import { ref } from 'vue'
  import { erFormEditor } from 'everright-formeditor'
  import 'Everright-formEditor/dist/style.css'
  const lang = ref('zh-cn')
  const EReditorRef = ref(null)
  const handleListener = async ({ type, data }) => {
    console.log('🚀 ~ handleListener ~ data:', data)
    switch (type) {
      case 'lang':
        lang.value = data
        break
    }
  }
</script>
